import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;
import redis.clients.jedis.params.SetParams;

import java.util.Set;

public class RedisDemo {

    public static void test(Jedis jedis) throws InterruptedException {
        jedis.flushAll();
        jedis.set("key", "value");
        jedis.expire("key", 10);
        Thread.sleep(1000);
        System.out.println(jedis.type("key"));
    }
    public static void main(String[] args) throws InterruptedException {
        JedisPool jedisPool = new JedisPool("tcp://localhost:8888");
        try(Jedis jedis = jedisPool.getResource()) {
            test(jedis);
        }
    }
}
